package com.gw.quotes.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gw.quotes.R;
import com.gw.quotes.domain.Specifications;
import com.gw.quotes.entity.business.Priceinfo.GoodsparamItem;

public class Goods0Adapter extends BaseAdapter {

	private List<GoodsparamItem> list;
	private Context context;
	private int resource;

	public Goods0Adapter(Context context, int layoutId,
			List<GoodsparamItem> list) {
		this.context = context;
		this.resource = layoutId;
		this.list = list;
	}

	@Override
	public int getCount() {
		return this.list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		GoodsparamItem goodsparam = list.get(position);
		if (convertView == null) {
			convertView = LayoutInflater.from(this.context).inflate(
					this.resource, parent, false);
		}
		TextView goods_title_text = (TextView) convertView
				.findViewById(R.id.goods_title_text);
		TextView goods_content_text = (TextView) convertView
				.findViewById(R.id.goods_content_text);
		goods_title_text.setText(goodsparam.getParamname());
		goods_content_text.setText(goodsparam.getParamvalue());
		return convertView;
	}

}
